package com.cai.servlet.common.user.log;

import com.cai.dao.ProcessInfoCenterDao;
import com.cai.dao.impl.ProcessInfoCenterDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author RuoLi
 */
@WebServlet(value = "/common/log/SendProcessInfoMessage", name = "SendProcessInfoMessage")
public class ServletSendProcessInfoMessage extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html;charset=utf-8");
        String userAccount = req.getParameter("userAccount");
        String messageContext = req.getParameter("messageContext");
        ProcessInfoCenterDao dao=new ProcessInfoCenterDaoImpl();
        int status= dao.sendProcessInfoMessage(Integer.parseInt(userAccount),messageContext);
        resp.getWriter().write(String.valueOf(status));
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
